js get first element by class

92

js get first element by class -

var elements = document.getElementsByClassName('className');
var requiredElement = elements[0];

Comments

Submit
0 Comments